home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Conversion / Convert_PICT / Convert PICT.app / UncommentedPSCode / Rectangles < prev    next >
Text File  |  1994-05-24  |  2KB  |  94 lines

  1. %BEGIN Rectangles
  2. /rectpath
  3. {
  4.     /lastright exch def
  5.     /lastbottom exch def
  6.     /lastleft exch def
  7.     /lasttop exch def
  8.     newpath
  9.         lastleft lasttop moveto
  10.         lastright lasttop lineto
  11.         lastright lastbottom lineto
  12.         lastleft lastbottom lineto
  13.     closepath
  14. }
  15. def
  16. /frameRect
  17. {
  18.     /lastright exch  def
  19.     /lastbottom exch  def
  20.     /lastleft exch def
  21.     /lasttop exch def
  22.     penWidth 0 gt
  23.     penHeight 0 gt
  24.     and
  25.     {
  26.         gsave
  27.             penPattern usePattern
  28.             newpath
  29.                 lastleft lasttop moveto
  30.                 lastright lasttop lineto
  31.                 lastright  lastbottom  lineto
  32.                 lastleft lastbottom lineto
  33.             closepath
  34.                 lastleft penWidth add    lasttop penHeight add   moveto
  35.                 lastleft penWidth add   lastbottom penHeight sub   lineto
  36.                 lastright penWidth sub   lastbottom penHeight sub   lineto
  37.                 lastright penWidth sub   lasttop penHeight add   lineto
  38.             closepath
  39.             fill
  40.         grestore
  41.     }
  42.     if
  43. }
  44. def
  45. /paintRect
  46. {
  47.     gsave
  48.         penPattern usePattern
  49.         rectpath
  50.         fill
  51.     grestore
  52. } def
  53. /eraseRect
  54. {
  55.     gsave
  56.         backPattern usePattern
  57.         rectpath
  58.         fill
  59.     grestore
  60. }
  61. def
  62. /invertRect
  63. {
  64.     gsave
  65.         rectpath
  66.     grestore
  67. }
  68. def
  69. /fillRect
  70. {
  71.     gsave
  72.         fillPattern usePattern
  73.         rectpath
  74.         fill
  75.     grestore
  76. }
  77. def
  78. /frameSameRect
  79.     { lasttop lastleft lastbottom lastright frameRect }
  80. def
  81. /paintSameRect
  82.     { lasttop lastleft lastbottom lastright paintRect }
  83. def
  84. /eraseSameRect
  85.     { lasttop lastleft lastbottom lastright eraseRect }
  86. def
  87. /invertSameRect
  88.     { lasttop lastleft lastbottom lastright invertRect }
  89. def
  90. /fillSameRect
  91.     { lasttop lastleft lastbottom lastright fillRect }
  92. def
  93. %END Rectangles
  94.